<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
// import { useUserStore } from './stores/user'
import { useRouter } from 'vue-router'
const router = useRouter()

// const user = useUserStore()
</script>

<template>
  <div class="container">

    <router-view></router-view>
    <!-- <div class="content"> -->
    <!-- <h3>民宿</h3> -->
    <!-- </div> -->

    <router-view>
      <footer class="footer" v-show="!$route.meta.hidden">
        <router-link to="/home">
          <span class="iconfont icon-shouye"></span>
          <van-icon name="wap-home-o" />
          <p>首页</p>
        </router-link>
        <router-link to="/find">
          <span class="iconfont icon-fenlei"></span>
          <van-icon name="eye-o" />
          <p>发现</p>
        </router-link>
        <router-link to="/chart">
          <span class="iconfont icon-gouwuche"></span>
          <van-icon name="chat-o" />
          <p>聊天</p>
        </router-link>
        <router-link to="/user">
          <span class="iconfont icon-My"></span>
          <!-- <p v-if="user.loginState">我的</p> -->
          <!-- <p v-else>未登录</p> -->
          <van-icon name="contact" />
          <p>我的</p>
        </router-link>
      </footer>
    </router-view>
  </div>
  <!-- 给用户提示用的 -->
  <div class="tip">
    请不要将屏幕横向使用
  </div>
</template>
<style lang="scss">
html,
body,
#app,
.container {
  height: 100%;
}

html {
  font-size: 26.6666666666vw;
}

body {
  font-size: 12px;
}

.container {
  display: flex;
  flex-direction: column;

}

/* .content {
  width: 100%;
  height: 50px;
  background-color: #f66;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
} */

/* .box {
  flex: 1;

  display: flex;
  flex-direction: column;
  overflow: auto;
} */

.box .header {
  height: 0.44rem;
  background-color: #f66;
  line-height: 0.44rem;
  text-align: center;
  color: white;
}

.box .content {
  overflow: auto;
}

.footer {
  height: 0.5rem;
  border-top: 1px solid gray;
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
}

.footer a {
  flex: 1;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 0.08rem;
  color: black;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}

.van-icon {
  font-size: 16px;
}

.footer a.router-link-active {
  color: #f66;
}

.tip {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  text-align: center;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 20px;
  /* 默认的时候将其隐藏掉，只有宽度大于高度的时候才会显示 */
  display: none;
  /* 设置内容不能被选中 */
  user-select: none;
}

/* 监听屏幕是横向显示的时候 */
@media all and (orientation: landscape) {
  .tip {
    display: flex;
  }
}

@media all and (min-width: 960px) {
  html {
    font-size: 100px;
  }
}
</style>